package com.hedl.practice.diyJava.gather.study_equals.practice;

import com.hedl.practice.diyJava.gather.study_equals.practice.tmp.Person;

import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args) {

        List<Person> list = Arrays.asList(new Person("Xiao","Ming",18),
                                            new Person("Xiao","Hong",25),
                                            new Person("Bob","Smith",20)
        );
        boolean exist = list.contains(new Person("Bob","Smith",20));
        System.out.println(list.indexOf(new Person("Xiao","Hong", 25)));
        System.out.println(exist ? "测试成功！":"测试失败!");
    }
}
